<template>
  <!--     @click-left="zuo" -->

  <div class="about">
    <van-nav-bar title="我的订单" color="#999999" size="33" left-arrow @click-left="onClickBack" >
      <template #right>
        <van-icon name="search" size="20" color="#999999" />
        <van-icon name="shopping-cart-o" size="20" color="#999999" />
      </template>
    </van-nav-bar>
    <van-tabs v-model="activeName" @click="btn" >
      <van-tab title="全部" >
      </van-tab>
      <van-tab title="待支付">
      
      </van-tab>
      <van-tab title="待收货">
      </van-tab>
      <van-tab title="待评论">
      </van-tab>
       <listss :shuJu="shuJu"></listss>
	   <gettrtr :getlisets="shuJu"></gettrtr>
    </van-tabs>
  </div>
</template>
<script>
import { database, databas } from "../lib/indent";
import listss from "../components/indent/order";
import gettrtr from "../components/homeym/getlisets";
export default {
  data() {
    return {
      shuJu: [],
      activeName:0,
      leiXing: "",
      lists: {},
      type:['all','paying','receiving','reviewing']
    };
  },
  created() {
    database({ type: "all" ,checkToken: true}).then(res => {
      if (res.msg === "ok") {
        this.shuJu = res.data;
        console.log(res)
        console.log(this.shuJu);
      }
    });
  },
  components: {
    listss,
    gettrtr
  },
  methods: {
    btn(name) {     
     var shu=this.type[this.activeName];
       database({ type: shu, checkToken: true }).then(res => {
            if (res.msg === "ok") {
              this.shuJu = res.data;
              console.log(this.shuJu);
            }
          });
    },
     onClickBack() {
      this.$router.go(-1);
    },
  }
};
</script>

<style scoped>

.about {
  background-color: #f5f5f5;
}
</style>